package com.example.threaddemo.t12;

import com.example.threaddemo.t11.MyThread;

/**
 * @Author：wlz
 * @Package：com.example.threaddemo.t12
 * @Project：threaddemo
 * @name：Run
 * @Date：2023/3/30 21:00
 * @Filename：Run
 */
public class Run {
    public static void main(String[] args) {
        try {
            com.example.threaddemo.t11.MyThread thread = new MyThread();
            thread.start();
            Thread.sleep(1000);
            thread.interrupt();
            System.out.println("是否停止1？="+thread.isInterrupted());
            System.out.println("是否停止2？="+thread.isInterrupted());
        }catch (InterruptedException e){
            System.out.println("main catch");
            e.printStackTrace();
        }
    }
}
